package com.luoqifei;
import org.apache.kafka.streams.KafkaStreams;
import org.apache.kafka.streams.StreamsConfig;
import org.apache.kafka.streams.kstream.KStreamBuilder;
import org.apache.kafka.streams.processor.TopologyBuilder;
public class KstreamFactory {
private KafkaStreams streams;
public void start(){
    streams.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
        @Override
        public void uncaughtException(Thread t, Throwable e) {
            //to examine the exception and perform an appropriate action
        }
    });
    streams.start();
}
   public void close(){
    streams.close();
   }
    public static void main(String[] args) {
        // Use the builders to define the actual processing topology, e.g. to specify
// from which input topics to read, which stream operations (filter, map, etc.)
// should be called, and so on.

       // KStreamBuilder builder = ...;  // when using the Kafka Streams DSL
//
// OR
//
        //TopologyBuilder builder = ...; // when using the Processor API

// Use the configuration to tell your application where the Kafka cluster is,
// which serializers/deserializers to use by default, to specify security settings,
// and so on.
       // StreamsConfig config = ...;

       // KafkaStreams streams = new KafkaStreams(builder, config);
    }
}

